<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="xm"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/backnav.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/admin.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/adminOrderlist.css">
<script type="text/javascript">
	function deleteOrder(orderId){
		if(confirm("您是否确认删除订单")){
			location.href='<%=request.getContextPath()%>/adminFilter/admin_order?m=deleteOrder&orderId='+orderId;
		}
	}
	function orderDetail(orderId){
		location.href='<%=request.getContextPath()%>/adminFilter/admin_order?m=orderListAndDetail&orderId='+orderId;
	}
	function updateOrderStatus(orderId)
	{
		location.href='<%=request.getContextPath()%>/adminFilter/admin_order?m=updateOrderStatus&orderId='+orderId;
	}
</script>
</head>
<body>
 	<div id="top">
 		<jsp:include page="/comm/backTop.jsp"></jsp:include>
 	</div>
    <div id="left">
        <jsp:include page="/comm/backnav.jsp"></jsp:include>
    </div>
    <div id="right">
        <div class="right">
        	<div class="main">
		 	 	 <table border="1">
		 	 	 	 <tr>
		 	 	 	 	<td class="td-th" colspan="8">订单查看</td>		
		 	 	 	 </tr>
		 	 	 	 <tr>
		 	 	 	 	 <th>订单ID</th>
		 	 	 	 	 <th>订单所属者ID</th>
		 	 	 	 	 <th>订单编号</th>
		 	 	 	 	 <th>订单日期</th>
		 	 	 	 	 <th>订单金额</th>
		 	 	 	 	 <th>状态</th>
		 	 	 	 	 <th colspan="2">操作</th>
		 	 	 	 </tr>
		 	 	 	 <xm:forEach items="${orderList }" var="ord">
			                <tr>
			                   <td>${ord.id }</td>
			                   <td>${ord.member }</td>
			                   <td>${ord.orderNO }</td>
			                   <td>${ord.orderDate }</td>
			                   <td>¥${ord.money }</td>
			                   <td>
		                   		   <xm:if test="${ord.orderStatus eq 1 }">	                       
			                                                                                 已下单，未处理
			                       </xm:if>
			                       <xm:if test="${ord.orderStatus eq 2 }">	                       
			                                                                                 已处理，未发货
			                       </xm:if>
			                       <xm:if test="${ord.orderStatus eq 3 }">	                       
			                                                                                订单完成
			                       </xm:if>
		                   	 	</td>
		                   	 	<td>
		                   	 	
                   		   <xm:if test="${ord.orderStatus eq 1 }">	                       
	                       	<a class="font_red" href="javascript:updateOrderStatus(${ord.id })">处理</a> 
	                       </xm:if>
	                       <xm:if test="${ord.orderStatus eq 2 }">	                       
                            <a class="font_red" href="javascript:updateOrderStatus(${ord.id })">发货</a> 
	                       </xm:if>
	                       <xm:if test="${ord.orderStatus eq 3 }">	                       
                           		完成
	                       </xm:if>
                   	 	</td>
                      
	                   <td>
	                       <a href="javascript:deleteOrder(${ord.id })">删除</a>
	                   </td>
	                </tr>
                </xm:forEach>
	 	       	</table>
	 	 	
        	</div>
        </div>
    </div>
</body>
</html>
